from rest_framework import serializers
from question.models import *


class BiaoSerializer(serializers.ModelSerializer):
    class Meta:
        model = Label

        fields = '__all__'


class QuestionSerializer(serializers.ModelSerializer):
    users = serializers.StringRelatedField()
    labels = serializers.StringRelatedField()

    class Meta:
        model = Question

        fields = '__all__'


class BiaoSerializer1(serializers.ModelSerializer):
    questions = QuestionSerializer(many=True)

    class Meta:
        model = Label

        fields = '__all__'


class BiaoSerializer2(serializers.ModelSerializer):
    class Meta:
        model = Label

        fields = ['id',
                  'label_name']
